
using CStock;
using System;
using System.Diagnostics;

using NUnit.Framework;
using TestCases.StockData;
using CUtil.Excel;
using System.Data;


namespace TestCases.Excel
{
	

	/// <summary>Some simple Tests.</summary>
	/// 
	[TestFixture] 
	public class Excel_EconomySimulations : ProgramContext_TestCases
	{

      
        
		
        //private const string excelFileName = @"c:\DAX.xls";

        public Excel_EconomySimulations()
		{
           
            
			
        }
        [SetUp]
        public void SetupMethod()
        {
            
        }

      
      
        private void SimulateFromExcelFile_nDays(string excelReadFileName, int nDays)
        {
            if (this.programContext.GetEconomyFromExcelFile(excelReadFileName))
            {
                ITradeEconomy myTradeEconomy = this.programContext.TradeEconomy;

                if (myTradeEconomy != null)
                {

                    for (int i = 0; i < nDays; i++)
                    {
                        this.programContext.TradeEconomy.AddOneDay();

                    }
                    //excelReader.UpdateShares(this.programContext.TradeEconomy);

                    this.programContext.ReadWriteExcel_Simulations(excelReadFileName);
                }
            }

        }
        [Test]
        public void A01_Simulation_SellAsset_ToCentralBank()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A01_Simulation_SellAsset_ToCentralBank.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 1);
        }
        [Test]
        public void A02_Simulation_BuyAsset_FromCentralBank()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A02_Simulation_BuyAsset_FromCentralBank.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 1);
        }

        [Test]
        public void A03_Simulation_BuyDeposit_FromCentralBank()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A03_Simulation_BuyDeposit_FromCentralBank.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 1);
        }
        [Test]
        public void A04_Simulation_SellDeposit_ToCentralBank()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A04_Simulation_SellDeposit_ToCentralBank.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 1);
        }
        [Test]
        public void A05_Simulation_BuyShare()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A05_Simulation_BuyShare.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 1);
        }
        [Test]
        public void A06_Simulation_BuyShareTwoTraders()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A06_Simulation_BuyShareTwoTraders.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 1);
        }
        [Test]
        public void A07_Simulation_BuyShareTwoTraders_DifferentBids_Error()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A07_Simulation_BuyShareTwoTraders_DifferentBids_Error.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 1);
        }
        [Test]
        public void A08_Simulation_BuyShareTwoTraders_DifferentBids()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A08_Simulation_BuyShareTwoTraders_DifferentBids.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 1);
        }
        [Test]
        public void A09_Simulation_BuyOnEquity()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A09_Simulation_BuyOnEquity.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 1);
        }
        [Test]
        public void A10_Simulation_BuyOnEquity()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A10_Simulation_BuyOnEquity.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 1);
        }
         [Test]
        public void A11_Simulation_BuyBond()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A11_Simulation_BuyBond.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 1);
        }
           [Test]
        public void A12_Simulation_BuyBondOnInterestRate()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A12_Simulation_BuyBondOnInterestRate.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 1);
        }
        [Test]
        public void A13_Simulation_BuyBondOnTradeSystemItem()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A13_Simulation_BuyBondOnTradeSystemItem.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 1);
        }
         [Test]
        public void A14_Simulation_BuyBondOnTradeSystemItem_10Days()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A14_Simulation_BuyBondOnTradeSystemItem_10Days.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 10);
        }
        [Test]
        public void A15_Simulation_BuySellBondOnTradeSystemItem_InterestChange()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A15_Simulation_BuySellBondOnTradeSystemItem_InterestChange.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 11);
        }
         [Test]
        public void A16_Simulation_TradeBondOnTS_BuysSell()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A16_Simulation_TradeBondOnTS_BuysSell.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 4);
        }
        [Test]
        public void A17_Simulation_TwoTraders_TwoBuySells()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A17_Simulation_TwoTraders_TwoBuySells.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 4);
        }
        [Test]
        public void A18_Simulation_CBTradeWithSystem_TwoTraders()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A18_Simulation_CBTradeWithSystem_TwoTraders.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 4);
        }
         [Test]
        public void A19_Simulation_TradeBreaks()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A19_Simulation_TradeBreaks.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 4);
        }
          [Test]
        public void A20_Simulation_TradeBreaks_Random()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A20_Simulation_TradeBreaks_Random.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 4);
        }
        [Test]
        public void A21_Simulation_TradeStart()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A21_Simulation_TradeStart.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 4);
        }
        [Test]
        public void A22_Simulation_TradeEnd()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A22_Simulation_TradeEnd.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 4);
        }
         [Test]
        public void A23_Simulation_News()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A23_Simulation_News.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 4);
        }
        [Test]
        public void A24_Simulation_StockNews()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A24_Simulation_StockNews.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 4);
        }
        [Test]
        public void A25_Simulation_InterestChange_Advanced()
        {
            string excelReadFileName = this.programContext.Path + @"\Simulations\A25_Simulation_InterestChange_Advanced.xls";
            SimulateFromExcelFile_nDays(excelReadFileName, 10);
        }
        
        
     
    
	}

	
}